package com.example.check_in.controller;

import com.example.check_in.service.ScheduleService;
import com.example.model.check_in.OrderDo;
import com.example.model.response.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

@RestController
@RequestMapping("/schedule")
public class ScheduleController {

    @Autowired
    private ScheduleService scheduleService;

    @PostMapping("/start")
    public Result startSchedule() {
        return Result.success(scheduleService.startSchedule());
    }

    @PostMapping("/enterInfo")
    public Result enterInfo(@RequestBody OrderDo order) {
        return Result.success(scheduleService.enterInfo(order));
    }

    @PostMapping("/confirmInfo")
    public Result confirmInfo() {
        return Result.success(scheduleService.confirmInfo());
    }

    @PostMapping("/makeDepositPayment")
    public Result makeDepositPayment(@RequestParam("paymentType") String paymentType, @RequestParam("pay") BigDecimal pay) {
        return Result.success(scheduleService.makeDepositPayment(paymentType, pay));
    }

}
